<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" import="com.zmht.specedu.vo.Systemgroup,java.util.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

%>
<%
	/**
	 * @author 张天兴
	 * @since 2009/05/07
	 */

 %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>聋校备课与语言学习及矫治系统</title>
<fmt:setBundle basename="PathResource" scope="session" />
<link href="<%=request.getContextPath()%>/<fmt:message key='StylePath' />style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/<fmt:message key='JavaScriptPath' />secret.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/<fmt:message key='jquery' />ajaxHelper.js"></script>
   <SCRIPT language="javascript">
      function selectlg(){        
         var userName = document.forms[0].userName.value;
      	 var password = document.forms[0].password.value;
      	 if(userName==""){
      	 	alert("用户名不能为空！");
      	 	document.forms[0].userName.focus();
      	 	return;
      	 }
      	 if(password==""){
      	 	alert("密码不能为空！");
      	 	document.forms[0].password.focus();
      	 	return;
      	 }
		if (md5_vm_test()) {    
			document.forms[0].password.value =  hex_md5(password);    
		} else {    
			alert("md5加密模块初始化失败");    
		}    
      	var url="systemAction.do?method=logon&userName="+userName;
      	url+="&password="+document.forms[0].password.value;
      	url+="&selectGroup="+document.forms[0].selectGroup.value;

      	//var qminoa =window.open(url,'_blank',"toolbar=no,menubar=no,titlebar=no,directories=no,resizable=no,status=no,fullscreen=yes,top=0;left=0,width=1024,height=768");
		var qminoa = openWindowFullScreen(url,1024,768,'听力语言康复辅助教学系统');
		qminoa.resizeTo(screen.width,screen.height);	
		qminoa.focus();
				
		self.window.opener=null;
        self.window.open('','_self');
		self.window.close();
		//window.location.href = url;			
        
      }
    window.onload = function(){
        resizewindows();
	  	var errors = '<c:out value="${errors}" />';
	  	if(errors!=""){
	  		alert(errors);
	  		document.forms[0].password.value = "";
	  		document.forms[0].userName.value = "";
	  		document.forms[0].userName.focus();
	  	}
  	}
    function resizewindows(){
       //window.top.moveTo(0,0);
       window.top.resizeTo(screen.availWidth,screen.availHeight);
       window.focus(); 
       
    }
      
    function document.onkeypress(){
         if ( event.keyCode=='13' ){
        	 selectlg();
         }
    }
   </SCRIPT> 
     
     
   
</head>

<body class="style1">
<form id="form1" name="form1" method="post" action="systemAction.do?method=logon">
  <table width="1003" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td colspan="3" align="center" valign="bottom"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />login/bg_01.gif" width="1003" height="281" /></td>
    </tr>
    <tr>
      <td width="409" align="right"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />login/bg_03.gif" width="409" height="130" /></td>
      <td width="233" align="center" valign="top" class="bgimg"><table width="100%" border="0" cellspacing="2" cellpadding="0">
        <tr>
          <td width="35%" align="right" valign="middle">用 户：</td>
          <td align="left"><input name="userName" type="text" class="boxcopy" value="" id="textfield"  style="width:110px;"/></td>
          </tr>
        <tr>
          <td align="right" valign="middle">密 码：</td>
          <td align="left"><input name="password" type="password" value="" class="boxcopy" id="textfield2"  style="width:110px;"/></td>
          </tr>
        <tr>
          <td align="right" valign="middle">系 统：</td>
          <td align="left" >
          <select class="boxcopy" id="selectname" name="selectGroup" style="width:113px;">
                 <%
					List groups = (List)request.getAttribute("groups");
					for(int i=0;i<groups.size();i++){
						Systemgroup group = (Systemgroup) groups.get(i);
				 %>
					<option value="<%=group.getId() %>" <%if(i==0) out.print("selected=\"selected\"");%> >
						<%=group.getGroupname() %>
					</option>
				<%
					}
				 %>
            </select>          
            </td>
          </tr>
        <tr>
          <td colspan="2" align="left" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="left"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />login/button_01.gif" style="CURSOR: hand;" width="114" height="50" border="0" onclick="selectlg();"  /></td>
              <td align="right"><a href="#" onfocus="this.blur()"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />login/button_02.gif" width="113" height="50" border="0"  onclick="document.forms[0].reset()" /></a></td>
            </tr>
          </table></td>
          </tr>
      </table></td>
      <td width="362" align="left"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />login/bg_04.gif" width="362" height="130" /></td>
    </tr>
    <tr>
      <td colspan="3" align="center" valign="top"><img src="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />login/bg_02.gif" width="1003" height="202" /></td>
    </tr>
    <tr>
     <!-- <td height="130" colspan="3" align="center" valign="top" background="<%=request.getContextPath() %>/<fmt:message key='CommonImagePath' />login/bg_06.gif">　</td>-->
    </tr>
  </table>

</form>
</body>
</html>
 